package com.micmac.main.view.compenents
{
	
	/*
	
	Author : Roy Raul.
	
	Component : SplashMediator             
	
	Version History         : 0.1 Date Jul-20-2011
	
	Current Version         : 0.1 Date Jul-20-2011
	
	Build Date              : Apr-14-2010
	
	*/
	
	import com.AppConst;
	import com.micmac.main.events.MainEvent;
	import com.micmac.main.events.SplashViewEvent;
	
	import flash.events.MouseEvent;
	
	import mx.controls.Alert;
	
	import org.robotlegs.mvcs.Mediator;
	
	
	
	
	public class SplashMediator extends Mediator
	{
		/*public function SplashMediator(){
			
			super();
		}*/
		[Inject] 
		public var splashScreen:SplashScreen;
		
		override public function onRegister():void
		{
			eventMap.mapListener(eventDispatcher, SplashViewEvent.LOADING_PROGRESS,onProgress);
		}
		
		private function onProgress(event:SplashViewEvent):void
		{
			splashScreen.progressBar.setProgress(event.loadingPercentage,100);
		}
		
		private function onLblSplashScreenClick(event:MouseEvent):void{
			dispatch(new MainEvent(MainEvent.INDEX_CHANGED, AppConst.BASE_PAGE_INDEX));
		}
	}
}